#pragma once 

#include <gtest/gtest.h>


namespace helper {
namespace sqlite {
  class IDB;
}//namespace sqlite
}//namespace helper

namespace test {

//create :memory" sqlite db file && open it 
class EmptyMemoryDBTest : public testing::Test {
protected:
	static void SetUpTestCase() ;
	static void TearDownTestCase();

protected:
	EmptyMemoryDBTest();
	~EmptyMemoryDBTest();

	helper::sqlite::IDB & db(){ 
		return _db;
	}

protected:
	static helper::sqlite::IDB * s_db;

	helper::sqlite::IDB & _db;
};

// TestCase::setup : create kv table 
// TestCase::teardown : drop the kv table
class MemoryDBTest : public EmptyMemoryDBTest {
protected:

	static void SetUpTestCase();
	static void TearDownTestCase();

  MemoryDBTest();
  ~MemoryDBTest() override ;

  void SetUp() override ;
  void TearDown() override ;

private:
	static void createTable(helper::sqlite::IDB & _db);
	static void dropTable(helper::sqlite::IDB & _db);

};
}//namespace test
